package com.lxp.basic.继承案例发红包;

import java.util.List;
import java.util.Scanner;

/**
 * @ClassName Test
 * @Aauthor swd
 * @Create 2019-12-04 14:11
 */


public class SendEnvelopeTest {
    public static void main(String[] args) {
        QunZhu qz = new QunZhu("叶秋", 200);
        //创建一个键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入金额：");
        int money = sc.nextInt();
        System.out.println("请输入个数：");
        int count = sc.nextInt();
        //发红包
        List<Double> sendList = qz.send(money, count);
        //判断余额
        if (sendList == null){
            System.out.println("余额不足。。。");
            return;
        }

        Member m1 = new Member("苏沐橙",5);
        Member m2 = new Member("唐柔",5);
        Member m3 = new Member("乔一帆",5);

        //开红包
        m1.open(sendList);
        m2.open(sendList);
        m3.open(sendList);
        //展示信息
        qz.show();
        m1.show();
        m2.show();
        m3.show();
    }
}
